import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type homeResult = {
  page: any;
  result: any
};

/** 公司简介查看 */
export const getaboutusselinfo = () => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/aboutus/selinfo`));
};



/** 公司简介修改 */
export const companyprofileupdateinfo = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/aboutus/updateinfo"), { data });
};



/** 公司荣誉列表 */
export const getselhonorinfo = () => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/aboutus/selhonorinfo`));
};



/** 修改公司荣誉列表 */
export const GSupdatehonor = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/aboutus/updatehonor"), { data });
};



/** 新增公司荣誉 */
export const aboutusinserthonor = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/aboutus/inserthonor"), { data });
};

/** 删除公司荣誉 */
export const aboutusdelhonorinfo = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/api/backend/aboutus/delhonorinfo/${userid}`));
};





/** 联系我们列表（公司办事处地址等） */
export const aboutusselcontactus = () => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/aboutus/selcontactus`));
};

/** 新增联系我们 */
export const aboutusinsertcontactus = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/aboutus/insertcontactus"), { data });
};


/** 删除联系我们 */
export const delcontactus = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/api/backend/aboutus/delcontactus/${userid}`));
};

/** 修改联系我们 */
export const aboutusupdatecontactus = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/aboutus/updatecontactus"), { data });
};







/** 分页查询新闻 */
export const newsselpage = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi(`/api/backend/news/selpage`), { data });
};

/** 新增新闻 */
export const newsinsertnews = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/news/insertnews"), { data });
};


/** 删除新闻 */
export const newsdelinfo = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/api/backend/news/delinfo/${userid}`));
};

/** 修改新闻 */
export const newsupdatenews = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/news/updatenews"), { data });
};



